<?php
class Zendhlt_Controller_AdminAction extends Zend_Controller_Action {
	
	public function preDispatch() {
		$auth = Zend_Auth::getInstance();
		if ($this->getRequest()->getActionName()!='uploadify') {
		if (!$auth->hasIdentity()) {
				if ($this->_request->getActionName() != 'login') {
					$this->_redirect('/admin/auth');
				}
			} else {
				$this->view->role = $auth->getIdentity()->role;
				// get an instance of Zend_Session_Namespace used by Zend_Auth
			    $authns = new Zend_Session_Namespace($auth->getStorage()->getNamespace());
			
			    // set an expiration on the Zend_Auth namespace where identity is held
			    $authns->setExpirationSeconds(60 * 30);
			}
		}
		
	}
}